import java.util.Scanner;

public class Main3{

    private static Scanner in;

    public static void main(String[] args) {
        in = new Scanner(System.in);
        int flag=1;
        int[] a=new int[5]; 
        String s;
        while(true){
            s=in.next();
            switch(s){
                case "arr":
                    try{
                        int i=in.nextInt();
                        a[i]=i;
                    }
                    catch(ArrayIndexOutOfBoundsException e){
                        System.out.println(e);
                        break;
                    }
                    break;
                case "null":
                    try{
                        a=null;
                        a[0]=0;
                    }
                    catch(NullPointerException e){
                        System.out.println(e);
                        a=new int[5];
                        break;
                    }
                    break;
                case "cast":
                    try{
                        Object st="123";
                        System.out.println((Integer)st);
                    }
                    catch (ClassCastException e) {
                        System.out.println(e);
                        break;
                    }
                    break;
                case "num":
                    try{
                        String ste=in.next();
                        Integer ke=Integer.parseInt(ste);
                    }
                    catch (NumberFormatException e) {
                        System.out.println(e);
                        break;
                    }
                    break;
                default:
                    flag=0;
                    break;
            }
            if (flag==0) {
                break;
            }

        }


    }
}
